﻿@{
    Layout = "~/Views/Samples/Generic/_Codebehind.cshtml";
}
@section cs_webforms_uploadsuccess
{
                    // Simulate post processing
                    for (int i = 0; i <= 100; i++)
                    {
                        e.UploadSession.ProcessingStatus["percentComplete"] = i.ToString();
                        e.UploadSession.ProcessingStatus["percentCompleteText"] = i.ToString() + "%";

                        SlickUploadContext.UpdateSession(e.UploadSession);

                        System.Threading.Thread.Sleep(100);
                    }

}
@section vb_webforms_uploadsuccess {
                    'Simulate post processing
                    For i As Integer = 0 To 100
                        e.UploadSession.ProcessingStatus("percentComplete") = i.ToString()
                        e.UploadSession.ProcessingStatus("percentCompleteText") = i.ToString() + "%"

                        SlickUploadContext.UpdateSession(e.UploadSession)

                        System.Threading.Thread.Sleep(100)
                    Next i

}

@section cs_mvc_uploadsuccess
{
                    if (session != null && session.State == UploadState.Complete && session.UploadedFiles.Count > 0)
                    {
                        // Simulate post processing
                        for (int i = 0; i <= 100; i++)
                        {
                            session.ProcessingStatus["percentComplete"] = i.ToString();
                            session.ProcessingStatus["percentCompleteText"] = i.ToString() + "%";

                            SlickUploadContext.UpdateSession(session);

                            System.Threading.Thread.Sleep(100);
                        }
                    }

}
@section vb_mvc_uploadsuccess {
                    If Not session Is Nothing AndAlso session.State = UploadState.Complete AndAlso session.UploadedFiles.Count > 0 Then
                        'Simulate post processing
                        For i As Integer = 0 To 100
                            session.ProcessingStatus("percentComplete") = i.ToString()
                            session.ProcessingStatus("percentCompleteText") = i.ToString() + "%"

                            SlickUploadContext.UpdateSession(session)

                            System.Threading.Thread.Sleep(100)
                        Next i
                    End If

}